package com.zzxx.mapper;

import com.zzxx.entity.Ticket;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;

public interface TicketMapperEx {
    @Results({
            @Result(column="id", property="id", jdbcType= JdbcType.VARCHAR, id=true),
            @Result(column="ticketType", property="tickettype", jdbcType=JdbcType.INTEGER),
            @Result(column="price", property="price", jdbcType=JdbcType.DOUBLE),
            @Result(column="effectiveTime", property="effectivetime", jdbcType=JdbcType.INTEGER),
            @Result(column="targetId", property="targetid", jdbcType=JdbcType.VARCHAR),
            @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
            @Result(column="src", property="src", jdbcType=JdbcType.VARCHAR),
            @Result(column ="targetId",property = "gym",
                    one = @One(select = "com.zzxx.mapper.GymMapper.selectByPrimaryKey"))
    })
    @Select("select * from ticket where id=#{tid}")
    public Ticket findOne(String tid);
}
